{{ 'section-multicolumn.css' | asset_url | stylesheet_tag }}
<link rel="stylesheet" href="{{ 'component-slider.css' | asset_url }}" media="print" onload="this.media='all'">
<noscript>{{ 'component-slider.css' | asset_url | stylesheet_tag }}</noscript>

<div class="spec_multicolumn cgo_spec" id="specs">
    <div class="multicolumn background-{{ section.settings.background_style }}{% if section.settings.title == blank %} no-heading{% endif %}">
        <div class="page-width">
         
          <details open>
            <summary>
              <div class="title-wrapper-with-link title-wrapper--self-padded-mobile{% if section.settings.title == blank %} title-wrapper-with-link--no-heading{% endif %}">
                <h2 class="title">
                  {{ section.settings.title | escape }}
                </h2>
                {%- if section.settings.button_label != blank and section.settings.swipe_on_mobile -%}
                  <a href="{{ section.settings.button_link }}" class="link underlined-link large-up-hide">{{ section.settings.button_label | escape }}</a>
                {%- endif -%}
              </div>
              <div class="ten-summary">
                {% render 'icon-qjia' %}
                {% render 'icon-qjian' %}
               </div>
            </summary>
            <slider-component class="slider-mobile-gutter">
              <ul class="multicolumn-list grid grid--1-col{% if section.blocks.size > 3 and section.settings.image_width != 'full' %} grid--2-col-tablet grid--4-col-desktop{% elsif section.blocks.size > 3 and section.settings.image_width == 'full' %} grid--2-col-tablet{% else %} grid--3-col-tablet{% endif %}{% if section.settings.swipe_on_mobile and section.blocks.size > 1 %} slider slider--mobile grid--peek{% endif %}"
                id="Slider-{{ section.id }}"
                role="list"
              >
                {%- liquid
                  assign highest_ratio = 0
                  for block in section.blocks
                    if block.settings.image.aspect_ratio > highest_ratio
                      assign highest_ratio = block.settings.image.aspect_ratio
                    endif
                  endfor
                -%}
                {%- for block in section.blocks -%}
                  <li class="multicolumn-list__item grid__item{% if section.settings.swipe_on_mobile %} slider__slide{% endif %}{% if section.settings.column_alignment == 'center' %} center{% endif %}" {{ block.shopify_attributes }}>
                    <div class="multicolumn-card">
                      {%- if block.settings.image != blank -%}
                        {% if section.settings.image_ratio == 'adapt' or section.settings.image_ratio == 'circle' %}
                          {% assign spaced_image = true %}
                        {% endif %}
                        <div class="multicolumn-card__image-wrapper multicolumn-card__image-wrapper--{{ section.settings.image_width }}-width{% if section.settings.image_width != 'full' or spaced_image %} multicolumn-card-spacing{% endif %}">
                          <div class="media media--transparent media--{{ section.settings.image_ratio }}"
                            {% if section.settings.image_ratio == 'adapt' %}
                              style="padding-bottom: {{ 1 | divided_by: highest_ratio | times: 100 }}%;"
                            {% endif %}>
                            <img
                              srcset="{%- if block.settings.image.width >= 275 -%}{{ block.settings.image | img_url: '275x' }} 275w,{%- endif -%}
                                {%- if block.settings.image.width >= 550 -%}{{ block.settings.image | img_url: '550x' }} 550w,{%- endif -%}
                                {%- if block.settings.image.width >= 710 -%}{{ block.settings.image | img_url: '710x' }} 710w,{%- endif -%}
                                {%- if block.settings.image.width >= 1420 -%}{{ block.settings.image | img_url: '1420x' }} 1420w,{%- endif -%}
                                {{ block.settings.image | img_url: 'master' }} {{ block.settings.image.width }}w"
                              src="{{ block.settings.image | img_url: '550x' }}"
                              sizes="(min-width: 990px) {% if section.blocks.size <= 2 %}710px{% else %}550px{% endif %},
                                (min-width: 750px) {% if section.blocks.size == 1 %}710px{% else %}550px{% endif %},
                                calc(100vw - 30px)"
                              alt="{{ block.settings.image.alt }}"
                              height="{{ block.settings.image.height }}"
                              width="{{ block.settings.image.width }}"
                              loading="lazy"
                            >
                          </div>
                        </div>
                      {%- endif -%}
                      <div class="multicolumn-card__info">
                        {%- if block.settings.title != blank -%}
                          <div class="rte">{{ block.settings.title }}</div>
                        {%- endif -%}
                        {%- if block.settings.text != blank -%}
                          <div class="rte">{{ block.settings.text }}</div>
                        {%- endif -%}
                      </div>
                    </div>
                  </li>
                {%- endfor -%}
              </ul>
        
             {%- if section.settings.note != blank -%}
               <div class="annotation">{{ section.settings.note }}</div>
              {%- endif -%}

            </slider-component>
          </details>

        </div>
      </div>
</div>


{% schema %}
{
  "name": "Specification3",
  "class": "spaced-section spaced-section--full-width cgo_summary",
  "tag": "section",
  "settings": [
    {
      "type": "text",
      "id": "title",
      "default": "Multicolumn",
      "label": "t:sections.multicolumn.settings.title.label"
    },
    {
      "type": "select",
      "id": "image_width",
      "options": [
        {
          "value": "third",
          "label": "t:sections.multicolumn.settings.image_width.options__1.label"
        },
        {
          "value": "half",
          "label": "t:sections.multicolumn.settings.image_width.options__2.label"
        },
        {
          "value": "full",
          "label": "t:sections.multicolumn.settings.image_width.options__3.label"
        }
      ],
      "default": "full",
      "label": "t:sections.multicolumn.settings.image_width.label"
    },
    {
      "type": "select",
      "id": "image_ratio",
      "options": [
        {
          "value": "adapt",
          "label": "t:sections.multicolumn.settings.image_ratio.options__1.label"
        },
        {
          "value": "portrait",
          "label": "t:sections.multicolumn.settings.image_ratio.options__2.label"
        },
        {
          "value": "square",
          "label": "t:sections.multicolumn.settings.image_ratio.options__3.label"
        },
        {
          "value": "circle",
          "label": "t:sections.multicolumn.settings.image_ratio.options__4.label"
        }
      ],
      "default": "adapt",
      "label": "t:sections.multicolumn.settings.image_ratio.label"
    },
    {
      "type": "select",
      "id": "column_alignment",
      "options": [
        {
          "value": "left",
          "label": "t:sections.multicolumn.settings.column_alignment.options__1.label"
        },
        {
          "value": "center",
          "label": "t:sections.multicolumn.settings.column_alignment.options__2.label"
        }
      ],
      "default": "left",
      "label": "t:sections.multicolumn.settings.column_alignment.label"
    },
    {
      "type": "select",
      "id": "background_style",
      "options": [
        {
          "value": "none",
          "label": "t:sections.multicolumn.settings.background_style.options__1.label"
        },
        {
          "value": "primary",
          "label": "t:sections.multicolumn.settings.background_style.options__2.label"
        },
        {
          "value": "secondary",
          "label": "t:sections.multicolumn.settings.background_style.options__3.label"
        }
      ],
      "default": "primary",
      "label": "t:sections.multicolumn.settings.background_style.label"
    },
    {
      "type": "text",
      "id": "button_label",
      "default": "Button label",
      "label": "t:sections.multicolumn.settings.button_label.label"
    },
    {
      "type": "url",
      "id": "button_link",
      "label": "t:sections.multicolumn.settings.button_link.label"
    },
    {
      "type": "checkbox",
      "id": "swipe_on_mobile",
      "default": false,
      "label": "t:sections.multicolumn.settings.swipe_on_mobile.label"
    },
    {
      "type": "text",
      "id": "note",
      "label": "Annotation"
    }
  ],
  "blocks": [
    {
      "type": "column",
      "name": "t:sections.multicolumn.blocks.column.name",
      "settings": [
        {
          "type": "image_picker",
          "id": "image",
          "label": "t:sections.multicolumn.blocks.column.settings.image.label"
        },
        {
          "type": "richtext",
          "id": "title",
          "label": "t:sections.multicolumn.blocks.column.settings.title.label"
        },
        {
          "type": "richtext",
          "id": "text",
          "default": "<p>Pair text with an image to focus on your chosen product, collection, or blog post. Add details on availability, style, or even provide a review.</p>",
          "label": "t:sections.multicolumn.blocks.column.settings.text.label"
        }
      ]
    }
  ],
  "presets": [
    {
      "name": "Specification3",
      "blocks": [
        {
          "type": "column"
        },
        {
          "type": "column"
        },
        {
          "type": "column"
        }
      ]
    }
  ]
}
{% endschema %}
